package org.example;

import com.typesafe.config.ConfigFactory;
import org.apache.pekko.actor.*;

public class Client extends AbstractActor {
    public static void main(String[] args) {
        ActorSystem actorSystem = ActorSystem.create("actorSystem", ConfigFactory.load("client"));
        ActorRef client = actorSystem.actorOf(Props.create(Client.class), "client");
        client.tell("C:\\Users\\81390\\.bash_profile" , ActorRef.noSender());
    }
    @Override
    public Receive createReceive() {
        return receiveBuilder().matchAny(this::handler).build() ;
    }

    private void handler(Object o) {
        String filePath = (String) o;
        ActorSelection actorSelection = context().actorSelection("pekko://actorSystem@127.0.0.1:17355/user/master");
        actorSelection.tell("start::" + filePath , getSelf());
    }

}
